<div data-hook="admin_user_lifetime_stats" class="panel panel-default">
  <div class="panel-heading">
    <h1 class="panel-title">
      <%= Spree.t(:lifetime_stats) %>
    </h1>
  </div>

  <table class="table" id="user-lifetime-stats" data-hook>
    <tr>
      <td width="30%"><%= Spree.t(:total_sales) %>:</td>
      <td><%= @user.display_lifetime_value.to_html %></td>
    </tr>
    <tr>
      <td><%= Spree.t(:num_orders) %>:</td>
      <td><%= @user.order_count.to_i %></td>
    </tr>
    <tr>
      <td><%= Spree.t(:average_order_value) %>:</td>
      <td><%= @user.display_average_order_value.to_html %></td>
    </tr>
    <tr>
      <td><%= Spree.t('admin.user.store_credits') %>:</td>
      <td><%= Spree::Money.new(@user.total_available_store_credit) %></td>
    </tr>
    <tr>
      <td><%= Spree.t(:member_since) %>:</td>
      <td><%= pretty_time(@user.created_at) %></td>
    </tr>
  </table>
</div>
